<?php
namespace app\common\validate;
use think\Validate;
class BisLocation extends Validate {
    protected $rule = [
        ['id','number'],
        ['bis_id','number'],
        ['tel','require','电话必须填写'],
        ['name','require|max:50','分店名称必须填写|分店名称不能超过50个字符'],
        ['logo','require','请上传缩略图'],
        ['address','require','商户地址必须填写'],
        ['contact','require','联系人必须填写'],
        ['category_id','require','请选择所选子类'],
        ['open_time','require','营业时间必须填写'],
        ['status','number|in:-1,0,1,2','状态必须是数字|状态范围不合法'],
    ];

    // 场景设置
    protected  $scene = [
        'mainadd' => ['bis_id', 'tel', 'address','contact','category_id', 'open_time'],
        'branchadd' => ['bis_id','name','logo', 'tel', 'address','contact','category_id', 'open_time'],
        'status' =>['id','status'],
    ];
}